package com.hdu.clj.dncard.util

import android.content.Context
import com.hdu.clj.dncard.R

class InitMaps {

    fun init(context: Context):ArrayList<ZxMap>{
        val len = 4
        val zxMapList = ArrayList<ZxMap>()
        zxMapList.add(ZxMap("阴影森林", R.drawable.main1))
        if (LoadAndSave().load("1",context).isNotEmpty()){
            zxMapList.add(ZxMap("未名湖畔", R.drawable.main2))
        }
        if (LoadAndSave().load("2",context).isNotEmpty()){
            zxMapList.add(ZxMap("紫禁之巅", R.drawable.main3))
        }
        if (LoadAndSave().load("3",context).isNotEmpty()){
            zxMapList.add(ZxMap("徘徊走廊", R.drawable.main4))
        }
        val number = len-zxMapList.size
        if (number>0){
            repeat(number){
                zxMapList.add(ZxMap("????",R.drawable.wz))
            }
        }
        return zxMapList
    }
}